<#assign pageName="操作日志详情">
<#assign statusArr = {"0": "正常","1":"异常"}>
<#assign businessArr = {"0":"其他","1":"新增","2":"修改","3":"删除"}>
<#assign operatorArr = {"0":"其他","1":"后台用户","2":"手机用户"}>
<@override name="head-styles">
<style>
    pre {border: 0px solid #ccc; padding: 5px; margin: 5px; }
    .string { color: green; }
    .number { color: darkorange; }
    .boolean { color: blue; }
    .null { color: magenta; }
    .key { color: red; }
</style>
</@override>
<@override name="page-content">
    <fieldset class="layui-elem-field layui-field-title">
        <legend>${pageName}</legend>
    </fieldset>
    <form class="layui-form">
         <@ctrl.LabelText path="sysOperLog.operTime" labelText="操作时间" />
         <@ctrl.LabelText path="sysOperLog.status" labelText="操作状态" value="${statusArr[sysOperLog.status?string]}"/>
         <@ctrl.LabelText path="sysOperLog.operName" labelText="操作用户" />
         <@ctrl.LabelText path="sysOperLog.deptName" labelText="部门名称" />
         <@ctrl.LabelText path="sysOperLog.title" labelText="操作模块" />
         <@ctrl.LabelText path="sysOperLog.businessType" labelText="业务类型" value="${businessArr[sysOperLog.businessType?string]}"/>
         <@ctrl.LabelText path="sysOperLog.method" labelText="请求方法" />
         <@ctrl.LabelText path="sysOperLog.requestMethod" labelText="请求方式" />
         <@ctrl.LabelText path="sysOperLog.operatorType" labelText="操作类别" value="${operatorArr[sysOperLog.operatorType?string]}"/>
         <@ctrl.LabelText path="sysOperLog.operUrl" labelText="请求url" />
         <@ctrl.LabelText path="sysOperLog.operIp" labelText="操作IP" />
         <@ctrl.LabelText path="sysOperLog.operLocation" labelText="操作地址" />
         <@ctrl.LabelText path="sysOperLog.operParam" labelText="请求参数" />
         <div class="layui-form-item" style="border: 1px solid #e6e6e6; margin-left:110px;">
              <pre id="reqparam"></pre>
         </div>
         <#if sysOperLog.jsonResult?has_content>
         <@ctrl.LabelText path="sysOperLog.jsonResult" labelText="返回参数" />
         <div class="layui-form-item" style="border: 1px solid #e6e6e6; margin-left:110px;">
              <pre id="retresult"></pre>
         </div>
         </#if>
         <#if sysOperLog.errorMsg?has_content>
         <@ctrl.LabelText path="sysOperLog.errorMsg" labelText="错误信息" />
         <div class="layui-form-item" style="border: 1px solid #e6e6e6; margin-left:110px;">
              <pre id="errormsg"></pre>
         </div>
         </#if>
         <@ctrl.FormAction buttons=["back"] backURL="../manage"/>
    </form> 
</@override>
<@override name="page-scripts">
    <script>
       $(function(){
           layui.use(['form','layer', 'jquery'], function(){
               var form = layui.form;
               var layer=layui.layer;
               $=layui.jquery;
               $('#reqparam').html(syntaxHighlight(${sysOperLog.operParam}));
               $('#retresult').html(syntaxHighlight(${sysOperLog.jsonResult}));
               $('#errormsg').html(syntaxHighlight(${sysOperLog.errorMsg}));
           })
       })
       function syntaxHighlight(json) {
            if (typeof json != 'string') {
                json = JSON.stringify(json, undefined, 2);
            }
            if (json != '' && json != undefined) {
                json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
                return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function(match) {
                    var cls = 'number';
                    if (/^"/.test(match)) {
                        if (/:$/.test(match)) {
                            cls = 'key';
                        } else {
                            cls = 'string';
                        }
                    } else if (/true|false/.test(match)) {
                        cls = 'boolean';
                    } else if (/null/.test(match)) {
                        cls = 'null';
                    }
                    return '<span class="' + cls + '">' + match + '</span>';
                });
            }
            return json;
        }
    </script>
</@override>
<@extends name="/layout/basepage.html"/> 